package com.example.administrator.pomelostreet.HttpUtils;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/2/9.
 */

public class NewClothesFragmentJson {

    public static List<NewClothesFragmentbeen> getjson(String path) {
        try {
            String json = new String(path);
            JSONObject jsonObject = new JSONObject(json);
            JSONObject data = jsonObject.getJSONObject("data");
            List<NewClothesFragmentbeen> arr = new ArrayList<>();
            JSONArray banner_data = data.getJSONArray("banner_data");
            for (int i = 0; i < banner_data.length(); i++) {
                JSONObject jsonObject1 = banner_data.getJSONObject(i);
                NewClothesFragmentbeen been = new NewClothesFragmentbeen();
                been.setPicture_url(jsonObject1.getString("picture_url"));
                arr.add(been);
            }
            return arr;
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }
}
